#pragma once

#include "../Common/Common.h"

#include "CameraBase.h"


class PSDF_CORE_DLL_DECL Camera2D : public CameraBase
{
public:
	Camera2D( OsgViewerBase * parentViewer, bool needRoam = true );

	~Camera2D();	

public:
	void					adjustCamera( Node * node, int viewWidth, int viewHeight );
	void					resize( int viewWidth, int viewHeight );
	void					setCameraPositionAndRange(double centerX, double centerY, double width, double height);

	void					worldToScreen( Vec3 world, int &x, int &y );
	void					screenToWorld( int scrX, int scrY, Vec3 &world );

	double					getViewportXRangeInWorld();
	double					getViewportYRangeInWorld();

protected:
	void					setCameraViewMatrix();
	void					setCameraProjectionMatrix();

	void					moveViewpoint( int currMouseX, int currMouseY );
	void					zoomIn( int delta );
	void					zoomOut( int delta );

	void					onFly();
	void					onFollow();
};